<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>西安新东方微信_西安新东方学校</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="设备预约表单">
    <meta name="keywords" content="设备预约表单">
    <meta name="author" content="XIAN Neworiental School Infomatiom Dept.">
    <!-- Le styles -->
    <link href="css/xian.css" rel="stylesheet">
    <link href="css/xian-responsive.css" rel="stylesheet">
    <link href="css/docs.css" rel="stylesheet">
    <link href="js/google-code-prettify/prettify.css" rel="stylesheet">

    <!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
    <!--[if lt IE 9]>
      <script src="../js/html5shiv.js"></script>
    <![endif]-->

    
    <!--集团统计开始-->
<!--neworiental全站异步 google分析开始-->
<script>
  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-20005525-1']);
  _gaq.push(['_setDomainName', '.xdf.cn']);
  _gaq.push(['_setAllowLinker', true]);
  _gaq.push(['_setAllowHash', false]);
  _gaq.push(['_addOrganic', 'soso', 'w']);
  _gaq.push(['_addOrganic', 'yodao', 'q']);
  _gaq.push(['_addOrganic', 'sogou', 'query']);
  _gaq.push(['_addOrganic', 'gougou', 'search']);
 _gaq.push(['_addOrganic', 'so.360.cn', 'q']);
   _gaq.push(['_trackPageview']);

</script>
<!-- google分析结束-->

  </head>

  <body data-spy="scroll" data-target=".bs-docs-sidebar">
<?php
  
//$link=mysql_connect('localhost','root','1111'); 
$username = "xaxdfhr";
$password = "wearetheworld1985";
try {
   $conn = new PDO('mysql:host=xaxdfdata.mysql.rds.aliyuncs.com;dbname=dbd86kw9q83xzn72', $username, $password);
   $conn -> setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
   $conn -> exec("SET NAMES 'utf8'");
    
    
   //这是一行需要引以为戒的代码片段→中文括号
   $insert = "insert into baoxiutai (name,email,department,phone,address,equipment,applydate)values (\"{$_POST['name']}\",\"{$_POST['email']}\",\"{$_POST['department']}\",\"{$_POST['phone']}\",\"{$_POST['address']}\",\"{$_POST['equipment']}\",now())";
      
   $conn -> exec($insert); 
   $res = $conn -> lastInsertId();
  if($res){
  echo "<script>alert ('预约成功！请保持电话畅通，等待信管部工作人员与您联系。');window.open ('http://xa.xdf.cn/','_self');</script>";
  exit;
  }else{
  //echo $res;
  echo "<script>alert ('您好，出错了。抱歉信息登记失败！请联系分机号7001提供错误信息，谢谢！');window.open ('http://xa.xdf.cn/','_self');</script>";
  exit;
  }
   
    
} catch(PDOException $e) {
   echo 'ERROR: ' . $e->getMessage();
   exit;
}

$conn = null;
?>



</body>
</html>